package designModel.proxy;

/**
 * 购物代理,静态代理实现
 */
public class ShopProxy implements Shopping {

    private final Supermarket supermarket;

    public ShopProxy(Supermarket supermarket) {
        this.supermarket = supermarket;
    }

    @Override
    public void buy(String goods) {
        System.out.println("开始代购:收取代理费");
        supermarket.buy(goods);
        System.out.println("代购之后:负责售后");
    }
}
